package com.ymttest.database.sqlwapper.sqrefund;

import java.util.List;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.sqrefund.MchRefundAddress;

public class MchRefundAddressWrapper {
	
	SqlManager manager;

	public MchRefundAddressWrapper() {
		manager = new SqlManager("sqrefund");
	}

	@SuppressWarnings("unchecked")
	public MchRefundAddress selectByPrimaryKey(Long id) {

		MchRefundAddress refundBill = null;
		List<MchRefundAddress> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.sqrefund.MchRefundAddressMapper.selectByPrimaryKey",
						id);
		manager.commit();

		if (result.size() > 0) {
			refundBill = result.get(0);
		}

		return refundBill;
	}
	
	@SuppressWarnings("unchecked")
	public MchRefundAddress selectByMerchantId(Long merchantId) {

		MchRefundAddress refundBill = null;
		List<MchRefundAddress> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.sqrefund.MchRefundAddressMapper.selectByMerchantId",
						merchantId);
		manager.commit();

		if (result.size() > 0) {
			refundBill = result.get(0);
		}

		return refundBill;
	}
	
	public static void main(String[] args) {
		
		MchRefundAddressWrapper test = new MchRefundAddressWrapper();
		
		System.out.println(test.selectByPrimaryKey(1L));
	}
}
